package org.testmyapp.entities;


public class InsuredPersonPk {

	public Integer contract;
	public Integer person;

	public InsuredPersonPk() {

	}

	public InsuredPersonPk(Integer contract, int person) {
		this.contract = contract;
		this.person = person;
	}

	@Override
	public boolean equals(Object other) {
		if (other == null) {
			return false;
		}
		if (!other.getClass().equals(this.getClass())) {
			return false;
		}
		InsuredPersonPk otherObject = (InsuredPersonPk) other;
		if (otherObject == this) {
			return true;
		}
		if (contract != null && otherObject.contract != null
				&& contract.equals(otherObject.contract)) {
			if (person != null && otherObject.person != null
					&& person.equals(otherObject.person)) {
				return true;
			}
		}
		return false;
	}
	
	@Override
	public int hashCode() {
		if(contract == null || person == null) {
			return 0;
		}
		else {
			return contract.hashCode() ^ person.hashCode();
		}
	}

}
